package dataStructure.xmg1.a15.queue;

import dataStructure.xmg1.a15.heap.BinaryHeap;

import java.util.Comparator;

/**
 * @author: vince_zww
 * @date: 2021/10/28 21:19
 * @desceription:
 */
public class PriorityQueue<E> {

    private BinaryHeap<E> heap;

    public PriorityQueue(Comparator<E> comparator) {
        heap = new BinaryHeap<>(comparator);

    }

    public PriorityQueue() {
        this(null);
    }

    private int size;


    public int size(){
        return heap.size();
    }

    public void clear(){
        heap.clear();
    }

    public boolean isEmpty(){
        return heap.isEmpty();
    }

    public void enQueue(E element) {
        heap.add(element);
    }

    public E deQueue(){
        return heap.remove();
    }

    public E front(){
        return heap.get();
    }
}
